<html>
<head><meta charset="utf-8"><title>choice of naming · project-safe-transmute · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/index.html">project-safe-transmute</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html">choice of naming</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203576036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576036">(Jul 11 2020 at 02:24)</a>:</h4>
<p>sorry for butting in like this, but isn't the choice of the word "transmute" lending itself to some confusion?</p>



<a name="203576105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576105">(Jul 11 2020 at 02:26)</a>:</h4>
<p>I would expect a feature like this to talk more about "reinterpreting data" or some such</p>



<a name="203576112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576112">(Jul 11 2020 at 02:26)</a>:</h4>
<p>although going through the hackmd I could find I'm seeing a combination of unsafe and safe APIs and it's possible the scope of this is much bigger than I expected</p>



<a name="203576193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576193">(Jul 11 2020 at 02:29)</a>:</h4>
<p>I'm approaching this from a very literal perspective: what trait would we put on the generic parameters of mem::transmute in order to make the intrinsic truly safe.</p>



<a name="203576196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576196">(Jul 11 2020 at 02:29)</a>:</h4>
<p>fair, and I was going to say that it definitely gives me that vibe</p>



<a name="203576199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576199">(Jul 11 2020 at 02:29)</a>:</h4>
<p>whereas I would start from as far away as possible</p>



<a name="203576204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576204">(Jul 11 2020 at 02:29)</a>:</h4>
<p>and categorize the types where it's safe at all to talk about the data in them</p>



<a name="203576251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576251">(Jul 11 2020 at 02:30)</a>:</h4>
<p>similar to previous discussions about "POD" or the other term which I've forgotten</p>



<a name="203576264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576264">(Jul 11 2020 at 02:30)</a>:</h4>
<p>IMO it's too easy to forget a certain kind of restriction, compared to starting with very limited reinterpretations</p>



<a name="203576284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576284">(Jul 11 2020 at 02:31)</a>:</h4>
<p>I can see there are examples involving references, whereas I would never even consider touching memory addresses</p>



<a name="203576286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576286">(Jul 11 2020 at 02:31)</a>:</h4>
<p>(but rather focus on "this is just a typed bag of bytes")</p>



<a name="203576337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576337">(Jul 11 2020 at 02:33)</a>:</h4>
<p>alright, you can ignore me and best of luck, I'll try not to get in the way of this, if there are any fundamental issues hopefully someone else finds them :P</p>



<a name="203576338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576338">(Jul 11 2020 at 02:33)</a>:</h4>
<p>Yeah, I actually started from that point too, contributing to Zerocopy. What struck me was the difficulty of creating a taxonomy of marker traits that covered every use case, and the difficulty of imagining their interactions with each other.</p>
<p>So with Typic, I sought to answer the question: Could all this be achieved with a small set of fundamental rules? And it can!</p>



<a name="203576396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/choice%20of%20naming/near/203576396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/choice.20of.20naming.html#203576396">(Jul 11 2020 at 02:34)</a>:</h4>
<p>And yeah, you're absolutely right that it's easy to overlook restrictions. I've tried to approach it from an everything-forbidden-by-default perspective. It's fine to be too restrictive.</p>
<p>A nice property of hiding everything behind a <code>TransmuteFrom</code> trait is that you don't need to add a whole new trait everytime you identify a class of operations that should be supported. <code>TransmuteFrom</code> can start 'dumb' and support very few transmutations, then gradually get smarter.</p>
<p>The reason that Typic and the RFC explore a very complex set of rules is to demonstrate that the API design doesn't fundamentally stifle that sort of sophistication.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>